import { Controller } from '@nestjs/common';
import { DatasetService } from './dataset.service';

@Controller('dataset')
export class DatasetController {
    // 注入 datasetService
    constructor(private readonly datasetService: DatasetService) { }

    // 增删改查
    async findAll(): Promise<any> {
        return await this.datasetService.findAll();
    }
    // findbyuser
    async findByUser(userId: string): Promise<any> {
        return await this.datasetService.findByUser(userId);
    }
    async findOne(id: number): Promise<any> {
        return await this.datasetService.findOne(id);
    }
    async create(data: any): Promise<any> {
        return await this.datasetService.create(data);
    }
    async update(id: number, data: any): Promise<any> {
        return await this.datasetService.update(id, data);
    }
    async delete(id: number): Promise<any> {
        return await this.datasetService.delete(id);
    }
}
